import { Injectable } from '@nestjs/common'
import { CreateCalculateTowerDto } from './dto/create-calculate-tower.dto'
import { UpdateCalculateTowerDto } from './dto/update-calculate-tower.dto'
import { PrismaService } from 'src/prisma/prisma.service'

@Injectable()
export class CalculateTowerService {
  constructor(private primsa: PrismaService) {}

  async create(createCalculateTowerDto: CreateCalculateTowerDto) {
    return await this.primsa.calculateTower.create({
      data: createCalculateTowerDto,
    })
  }

  async findAll(args: Record<string, any>) {
    const { orderId } = args
    return await this.primsa.calculateTower.findMany({ where: { orderId } })
  }

  findOne(id: number) {
    return `This action returns a #${id} calculateTower`
  }

  update(id: number, updateCalculateTowerDto: UpdateCalculateTowerDto) {
    return `This action updates a #${id} calculateTower`
  }

  remove(id: number) {
    return `This action removes a #${id} calculateTower`
  }

  // 计算
  calculate(id: number) {}
}
